package com.yunxin.websitebox.website.config;

import com.asual.lesscss.LessServlet;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class LessConfig {
    //注册Servlet
    @Bean
    public ServletRegistrationBean lessServlet(){
        ServletRegistrationBean bean = new ServletRegistrationBean(new LessServlet(), "*.less");
        bean.addInitParameter("compress","true");
        bean.addInitParameter("cache","false");
        bean.setLoadOnStartup(1);
        return bean;
    }

}
